package util;


import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;


public class UserJwt extends User {
    // 令牌载荷信息存储的内容
    private String nickName; // 用户昵称

    public UserJwt(String username, String password, Collection<? extends GrantedAuthority> authorities, String nickName) {
        super(username, password, authorities);
        this.nickName = nickName;
    }

    /**
     *
     * @param username
     * @param password
     * @param enabled 用户是否可用
     * @param accountNonExpired 用户帐号是否已过期
     * @param credentialsNonExpired 用户凭证是否已过期
     * @param accountNonLocked 用户帐号是否已被锁定
     * @param authorities
     * @param nickName
     */
    public UserJwt(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, String nickName) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }
}
